/*******************************************************************************
 * Copyright (c) 2006 CEA List.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     CEA List - initial API and implementation
 *******************************************************************************/
package com.cea.papyrus.diagram.deployment.preference;

import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.preference.PreferenceConverter;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.graphics.RGB;

import com.cea.papyrus.core.preference.PreferenceConstants;

/**
 * Defines constants for deployment diagram preferences.
 * 
 * @author Gilles Cannenterre
 * @since 15 janv. 07
 */
public class DeploymentDiagramPreferenceConstants {

	// Artifact
	/**
	 * The Constant P_ARTIFACT_BACKGROUNDCOLOR.
	 */
	public static final String P_ARTIFACT_BACKGROUNDCOLOR = "DeploymentDiagramPreferenceConstants.Artifact.backGroundColor";
	
	/**
	 * The Constant P_ARTIFACT_BORDERCOLOR.
	 */
	public static final String P_ARTIFACT_BORDERCOLOR = "DeploymentDiagramPreferenceConstants.Artifact.borderColor";
	
	/**
	 * The Constant P_ARTIFACT_FONTCOLOR.
	 */
	public static final String P_ARTIFACT_FONTCOLOR = "DeploymentDiagramPreferenceConstants.Artifact.fontColor";
	
	/**
	 * The Constant P_ARTIFACT_FONT.
	 */
	public static final String P_ARTIFACT_FONT = "DeploymentDiagramPreferenceConstants.Artifact.font";
	
	// DeploymentSpecification
	/**
	 * The Constant P_DEPLOYMENTSPECIFICATION_BACKGROUNDCOLOR.
	 */
	public static final String P_DEPLOYMENTSPECIFICATION_BACKGROUNDCOLOR = "DeploymentDiagramPreferenceConstants.DeploymentSpecification.backGroundColor";
	
	/**
	 * The Constant P_DEPLOYMENTSPECIFICATION_BORDERCOLOR.
	 */
	public static final String P_DEPLOYMENTSPECIFICATION_BORDERCOLOR = "DeploymentDiagramPreferenceConstants.DeploymentSpecification.borderColor";
	
	/**
	 * The Constant P_DEPLOYMENTSPECIFICATION_FONTCOLOR.
	 */
	public static final String P_DEPLOYMENTSPECIFICATION_FONTCOLOR = "DeploymentDiagramPreferenceConstants.DeploymentSpecification.fontColor";
	
	/**
	 * The Constant P_DEPLOYMENTSPECIFICATION_FONT.
	 */
	public static final String P_DEPLOYMENTSPECIFICATION_FONT = "DeploymentDiagramPreferenceConstants.DeploymentSpecification.font";

	// Device
	/**
	 * The Constant P_DEVICE_BACKGROUNDCOLOR.
	 */
	public static final String P_DEVICE_BACKGROUNDCOLOR = "DeploymentDiagramPreferenceConstants.Device.backGroundColor";
	
	/**
	 * The Constant P_DEVICE_BORDERCOLOR.
	 */
	public static final String P_DEVICE_BORDERCOLOR = "DeploymentDiagramPreferenceConstants.Device.borderColor";
	
	/**
	 * The Constant P_DEVICE_FONTCOLOR.
	 */
	public static final String P_DEVICE_FONTCOLOR = "DeploymentDiagramPreferenceConstants.Device.fontColor";
	
	/**
	 * The Constant P_DEVICE_FONT.
	 */
	public static final String P_DEVICE_FONT = "DeploymentDiagramPreferenceConstants.Device.font";
	
	// ExecutionEnvironment
	/**
	 * The Constant P_EXECUTIONENVIRONMENT_BACKGROUNDCOLOR.
	 */
	public static final String P_EXECUTIONENVIRONMENT_BACKGROUNDCOLOR = "DeploymentDiagramPreferenceConstants.ExecutionEnvironment.backGroundColor";
	
	/**
	 * The Constant P_EXECUTIONENVIRONMENT_BORDERCOLOR.
	 */
	public static final String P_EXECUTIONENVIRONMENT_BORDERCOLOR = "DeploymentDiagramPreferenceConstants.ExecutionEnvironment.borderColor";
	
	/**
	 * The Constant P_EXECUTIONENVIRONMENT_FONTCOLOR.
	 */
	public static final String P_EXECUTIONENVIRONMENT_FONTCOLOR = "DeploymentDiagramPreferenceConstants.ExecutionEnvironment.fontColor";
	
	/**
	 * The Constant P_EXECUTIONENVIRONMENT_FONT.
	 */
	public static final String P_EXECUTIONENVIRONMENT_FONT = "DeploymentDiagramPreferenceConstants.ExecutionEnvironment.font";
	
	// Node
	/**
	 * The Constant P_NODE_BACKGROUNDCOLOR.
	 */
	public static final String P_NODE_BACKGROUNDCOLOR = "DeploymentDiagramPreferenceConstants.Node.backGroundColor";
	
	/**
	 * The Constant P_NODE_BORDERCOLOR.
	 */
	public static final String P_NODE_BORDERCOLOR = "DeploymentDiagramPreferenceConstants.Node.borderColor";
	
	/**
	 * The Constant P_NODE_FONTCOLOR.
	 */
	public static final String P_NODE_FONTCOLOR = "DeploymentDiagramPreferenceConstants.Node.fontColor";
	
	/**
	 * The Constant P_NODE_FONT.
	 */
	public static final String P_NODE_FONT = "DeploymentDiagramPreferenceConstants.Node.font";
	
	/**
	 * Gets the preference artifact background color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference artifact background color
	 */
	public static RGB getPreferenceArtifactBackgroundColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_ARTIFACT_BACKGROUNDCOLOR);
	}
	
	/**
	 * Gets the preference artifact border color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference artifact border color
	 */
	public static RGB getPreferenceArtifactBorderColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_ARTIFACT_BORDERCOLOR);
	}
	
	/**
	 * Gets the preference artifact font color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference artifact font color
	 */
	public static RGB getPreferenceArtifactFontColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_ARTIFACT_FONTCOLOR);
	}

	/**
	 * Gets the preference artifact font.
	 * 
	 * @param store the store
	 * 
	 * @return the preference artifact font
	 */
	public static FontData[] getPreferenceArtifactFont(IPreferenceStore store) {
		return PreferenceConverter.getFontDataArray(store, P_ARTIFACT_FONT);
	}

	/**
	 * Gets the preference deployment specification background color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference deployment specification background color
	 */
	public static RGB getPreferenceDeploymentSpecificationBackgroundColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_DEPLOYMENTSPECIFICATION_BACKGROUNDCOLOR);
	}
	
	/**
	 * Gets the preference deployment specification border color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference deployment specification border color
	 */
	public static RGB getPreferenceDeploymentSpecificationBorderColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_DEPLOYMENTSPECIFICATION_BORDERCOLOR);
	}
	
	/**
	 * Gets the preference deployment specification font color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference deployment specification font color
	 */
	public static RGB getPreferenceDeploymentSpecificationFontColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_DEPLOYMENTSPECIFICATION_FONTCOLOR);
	}

	/**
	 * Gets the preference deployment specification font.
	 * 
	 * @param store the store
	 * 
	 * @return the preference deployment specification font
	 */
	public static FontData[] getPreferenceDeploymentSpecificationFont(IPreferenceStore store) {
		return PreferenceConverter.getFontDataArray(store, P_DEPLOYMENTSPECIFICATION_FONT);
	}

	/**
	 * Gets the preference device background color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference device background color
	 */
	public static RGB getPreferenceDeviceBackgroundColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_DEVICE_BACKGROUNDCOLOR);
	}
	
	/**
	 * Gets the preference device border color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference device border color
	 */
	public static RGB getPreferenceDeviceBorderColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_DEVICE_BORDERCOLOR);
	}
	
	/**
	 * Gets the preference device font color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference device font color
	 */
	public static RGB getPreferenceDeviceFontColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_DEVICE_FONTCOLOR);
	}

	/**
	 * Gets the preference device font.
	 * 
	 * @param store the store
	 * 
	 * @return the preference device font
	 */
	public static FontData[] getPreferenceDeviceFont(IPreferenceStore store) {
		return PreferenceConverter.getFontDataArray(store, P_DEVICE_FONT);
	}

	/**
	 * Gets the preference execution environment background color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference execution environment background color
	 */
	public static RGB getPreferenceExecutionEnvironmentBackgroundColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_EXECUTIONENVIRONMENT_BACKGROUNDCOLOR);
	}
	
	/**
	 * Gets the preference execution environment border color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference execution environment border color
	 */
	public static RGB getPreferenceExecutionEnvironmentBorderColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_EXECUTIONENVIRONMENT_BORDERCOLOR);
	}
	
	/**
	 * Gets the preference execution environment font color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference execution environment font color
	 */
	public static RGB getPreferenceExecutionEnvironmentFontColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_EXECUTIONENVIRONMENT_FONTCOLOR);
	}

	/**
	 * Gets the preference execution environment font.
	 * 
	 * @param store the store
	 * 
	 * @return the preference execution environment font
	 */
	public static FontData[] getPreferenceExecutionEnvironmentFont(IPreferenceStore store) {
		return PreferenceConverter.getFontDataArray(store, P_EXECUTIONENVIRONMENT_FONT);
	}
	
	/**
	 * Gets the preference node background color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference node background color
	 */
	public static RGB getPreferenceNodeBackgroundColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_NODE_BACKGROUNDCOLOR);
	}
	
	/**
	 * Gets the preference node border color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference node border color
	 */
	public static RGB getPreferenceNodeBorderColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_NODE_BORDERCOLOR);
	}
	
	/**
	 * Gets the preference node font color.
	 * 
	 * @param store the store
	 * 
	 * @return the preference node font color
	 */
	public static RGB getPreferenceNodeFontColor(IPreferenceStore store) {
		return PreferenceConverter.getColor(store, P_NODE_FONTCOLOR);
	}

	/**
	 * Gets the preference node font.
	 * 
	 * @param store the store
	 * 
	 * @return the preference node font
	 */
	public static FontData[] getPreferenceNodeFont(IPreferenceStore store) {
		return PreferenceConverter.getFontDataArray(store, P_NODE_FONT);
	}
	
	/**
	 * Sets the default preferences of the Actor, UseCase and ExtensionPoint preference pages.
	 * 
	 * @param store the store
	 */
	public static void setDefaultPreferences(IPreferenceStore store) {
		// Artifact
		PreferenceConverter.setDefault(store, P_ARTIFACT_BACKGROUNDCOLOR, PreferenceConstants.getPapyrusColorYellow());
		PreferenceConverter.setDefault(store, P_ARTIFACT_BORDERCOLOR, PreferenceConstants.getPapyrusColorBrown());
		PreferenceConverter.setDefault(store, P_ARTIFACT_FONTCOLOR, PreferenceConstants.getPapyrusColorBlack());
		PreferenceConverter.setDefault(store, P_ARTIFACT_FONT, new FontData("Arial", 10, SWT.BOLD));
		
		// DeploymentSpecification
		PreferenceConverter.setDefault(store, P_DEPLOYMENTSPECIFICATION_BACKGROUNDCOLOR, PreferenceConstants.getPapyrusColorYellow());
		PreferenceConverter.setDefault(store, P_DEPLOYMENTSPECIFICATION_BORDERCOLOR, PreferenceConstants.getPapyrusColorBrown());
		PreferenceConverter.setDefault(store, P_DEPLOYMENTSPECIFICATION_FONTCOLOR, PreferenceConstants.getPapyrusColorBlack());
		PreferenceConverter.setDefault(store, P_DEPLOYMENTSPECIFICATION_FONT, new FontData("Arial", 10, SWT.BOLD));

		// Device
		PreferenceConverter.setDefault(store, P_DEVICE_BACKGROUNDCOLOR, PreferenceConstants.getPapyrusColorYellow());
		PreferenceConverter.setDefault(store, P_DEVICE_BORDERCOLOR, PreferenceConstants.getPapyrusColorBrown());
		PreferenceConverter.setDefault(store, P_DEVICE_FONTCOLOR, PreferenceConstants.getPapyrusColorBlack());
		PreferenceConverter.setDefault(store, P_DEVICE_FONT, new FontData("Arial", 10, SWT.BOLD));
		
		// ExecutionEnvironment
		PreferenceConverter.setDefault(store, P_EXECUTIONENVIRONMENT_BACKGROUNDCOLOR, PreferenceConstants.getPapyrusColorYellow());
		PreferenceConverter.setDefault(store, P_EXECUTIONENVIRONMENT_BORDERCOLOR, PreferenceConstants.getPapyrusColorBrown());
		PreferenceConverter.setDefault(store, P_EXECUTIONENVIRONMENT_FONTCOLOR, PreferenceConstants.getPapyrusColorBlack());
		PreferenceConverter.setDefault(store, P_EXECUTIONENVIRONMENT_FONT, new FontData("Arial", 10, SWT.BOLD));
		
		// Node
		PreferenceConverter.setDefault(store, P_NODE_BACKGROUNDCOLOR, PreferenceConstants.getPapyrusColorYellow());
		PreferenceConverter.setDefault(store, P_NODE_BORDERCOLOR, PreferenceConstants.getPapyrusColorBrown());
		PreferenceConverter.setDefault(store, P_NODE_FONTCOLOR, PreferenceConstants.getPapyrusColorBlack());
		PreferenceConverter.setDefault(store, P_NODE_FONT, new FontData("Arial", 10, SWT.BOLD));
	}		
}